<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript" src="js/vue.js">

		</script>
	</head>
	<body>
		<div id="add">
			<button @click="show()">[show]</button>
			<button @click="display()">[display]</button>
		</div>
	</body>
	<script type="text/javascript">
		var vm = new Vue({
			el: "#add",
			data: {
				age: 18,
				num:5
			},
			methods: {
				show: function() {
					alert("alert show!")
				},
				display() {
					while (vm.num>=0) {
						if(vm.num == 0){
							alert("0000");
							break;
						}
						alert("alert display! "+vm.num);
						vm.num = vm.num-1;
					}
				}
			}
		})
	</script>
</html>
